package test;


import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class test1 {

//    public void setName () {
//        Test2 t = new Test2();
//        t.setTestProperties("mini");
//        System.out.println(t.age);
//    }



    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException, InstantiationException {
        Test2 t = new Test2();
        Class<?> t2 = Test2.class;

        Method method = t2.getDeclaredMethod("hello", String.class);
        method.setAccessible(true);
        method.invoke(t, "world");
    }
}
